{% block createnew %}{% endblock %}

{% block createmodal %}{% endblock %}

{% include('ownership-transfer-modal.html') %}

{# BOOKING PARAMS #}
{% include('booking-params-modal.html') %}
{# IMPORT FROM PUBCHEM #}
{% include('import-pubchem-modal.html') %}
{# PROCUREMENT PARAMS #}
{% include('procurement-params-modal.html') %}
{# BOOKINGS EMAIL #}
{% if Entity.entityData.type == 'items' and Entity.entityData.is_bookable == 1 %}
  {% include 'bookings-email-modal.html' %}
{% endif %}

<div id='isArchivedDiv'>
{% if Entity.entityData.state == enum('Elabftw\\Enums\\State').Archived.value %}
  {{ 'This entry is archived: it will not appear in the listings by default.'|trans|msg('ok', false) }}
{% endif %}
</div>

{# REQUEST ACTIONS #}
<div id='requestActionsDiv'>
  {% if entityRequestActionsArr %}
    <ul class='list-group mt-2'>
      {% for action in entityRequestActionsArr %}
        <li class='list-group-item'>
          <div class='d-flex'>
            <i class='fas fa-person-circle-exclamation color-blue mr-2'></i>
            <div>
              {{- '%s has requested %s for this entity from %s'|trans|format(
                action.requester_fullname,
                action.description,
                action.target_fullname
              ) }} <span title='{{ action.created_at }}' class='relative-moment text-nowrap smallgray ml-2'></span>
              <div class='mt-2'>
                {% if action.target_userid == App.Users.userData.userid %}
                  <button type='button' class='btn btn-primary btn-sm mr-2' data-action='do-requestable-action' data-target='{{ action.target }}'>{{ action.action }}</button>
                {% endif %}
                {% if action.requester_userid == App.Users.userData.userid or action.target_userid == App.Users.userData.userid %}
                  <button type='button' class='btn btn-sm btn-ghost' data-action='cancelrequestableaction' data-id='{{ action.id }}'>{{ 'Cancel'|trans }}</button>
                {% endif %}
              </div>
            </div>
          </div>
        </li>
      {% endfor %}
    </ul>
  {% endif %}
</div>
{# PROCUREMENT REQUESTS #}
<div id='procurementRequestsDiv'>
  {% if entityProcurementRequestsArr %}
    <ul class='list-group mt-2'>
      {% for req in entityProcurementRequestsArr %}
        <li class='list-group-item'>
          <i class='fas fa-cart-shopping mr-2'></i>
          {{ 'A procurement request has been made by %s for a quantity of %d'|format(req.requester_fullname, req.qty_ordered)|trans }}<span title='{{ req.created_at }}' class='relative-moment text-nowrap smallgray ml-2'></span>
        </li>
      {% endfor %}
    </ul>
  {% endif %}
</div>
